Fixed tests and removed the unnecessary comment
authorKalita Alexey <kalita.alexey@outlook.com>
Fri, 20 Jan 2017 05:12:12 +0000 (08:12 +0300)
committerKalita Alexey <kalita.alexey@outlook.com>
Fri, 20 Jan 2017 05:12:12 +0000 (08:12 +0300)
src/cargo/core/manifest.rs
tests/build.rs

index a78e1856e34feefdd8507e0e777f8dbe88010964..a385c9a8ffd1566d2f2a734ff2b687d860168846 100644 (file)
@@ -113,7 +113,6 @@ impl Encodable for TargetKind {
     fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
         match *self {
             TargetKind::Lib(ref kinds) |
-            // TODO: I am not sure whether it should be encoded like a library or like an example
             TargetKind::ExampleLib(ref kinds) => {
                 kinds.iter().map(LibKind::crate_type).collect()
             }
index af1ad23e0159e04881e4af5e16286517a68c61c6..549ae35e8758a9bf5cc81031165134a133131ab5 100644 (file)
@@ -1924,7 +1924,7 @@ fn example_as_rlib() {
             crate-type = ["rlib"]
         "#)
         .file("src/lib.rs", "")
-        .file("examples/ex.rs", "fn a() {}");
+        .file("examples/ex.rs", "");
 
     assert_that(p.cargo_process("build").arg("--example=ex"), execs().with_status(0));
     assert_that(&p.example_lib("ex", "rlib"), existing_file());
@@ -1964,7 +1964,7 @@ fn example_as_proc_macro() {
             crate-type = ["proc-macro"]
         "#)
         .file("src/lib.rs", "")
-        .file("examples/ex.rs", "");
+        .file("examples/ex.rs", "#![feature(proc_macro)]");
 
     assert_that(p.cargo_process("build").arg("--example=ex"), execs().with_status(0));
     assert_that(&p.example_lib("ex", "proc-macro"), existing_file());